<template>
  <div class="left-top">
    <nav class="item-content" v-for="(item,index) in 4">
      <div class="icon" :style="{ backgroundImage: `url(${url(index + 1)})`}"></div>
      <div class="label">
        <div class="label-top">
          <strong class="number">26</strong>
          <span class="suffix">万亩</span>
        </div>
        <div class="name">2022玉米制种面积</div>
      </div>
    </nav>
  </div>
</template>

<script setup lang="ts" name="LeftTop">
const url = (index:number) => {
  // 参数一: 相对路径
  // 参数二: 当前路径的URL
  return new URL(`../assets/left-top/icon${index}.svg`, import.meta.url).href
}
</script>

<style scoped lang="less">
.left-top{
  width: 453px;
  height: 280px;
  position: absolute;
  left: 20px;
  top: 120px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  .item-content{
    width: 49%;
    height: 49%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .icon{
      width: 90px;
      height: 110px;
    }
    .label{
      margin-bottom: 35px;
      .number{
        font-size: 45px;
      }
      .label-top{
        background-image: linear-gradient(180deg, #FFFFFF 0%, #00FFE0 100%);
        -moz-background-clip: text;
        -webkit-background-clip: text;
        -o-background-clip: test;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        .number{
          font-family: "宋体";
        }
        .suffix{
          font-size: 14px;
          font-weight: 900;
        }
      }
      .name{
        font-size: 14px;
        color: white;
        font-weight: 600;
      }
    }
  }
}
</style>
